/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package FlightTasks;

import Transports.Flight;
import airportmap.MercatorToXY;

/**
 *
 * @author oleg
 */
public class TaskFlyStraight extends Task{

    public TaskFlyStraight(double timeCreated) {
        super(timeCreated);
    }

    @Override
    public Task getCopy() {
        return new TaskFlyStraight(timeCreated);
    }

    @Override
    public void nextStep(Flight f) {
        double dt=1;
        double xm=MercatorToXY.merc_x(f.getX())+f.getFullvel()*Math.cos(f.getFlightAngle())*dt;
        f.setX(MercatorToXY.unmerc_x(xm));
        double ym=MercatorToXY.mercY(f.getY())+f.getFullvel()*Math.sin(f.getFlightAngle())*dt;
        f.setY(MercatorToXY.unmerc_y(ym));
    }

    



}
